package com.huli.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.huli.domain.Patient;
import com.huli.service.PatientService;
import com.huli.mapper.PatientMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 张庆阳
* @description 针对表【patient】的数据库操作Service实现
* @createDate 2025-03-13 11:18:38
*/
@Service
public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient>
    implements PatientService{
@Autowired
private PatientMapper patientMapper;
    @Override
    public Patient findById(Integer id) {
       Patient patient= patientMapper.findById(id);
       return patient;
    }

    @Override
    public List<Patient> findAll() {
        List<Patient> patient=patientMapper.findAll();
      return patient;
    }

    @Override
    public Integer deleteById(Integer id) {
        int deleteById = patientMapper.deleteById(id);
        return deleteById;
    }

    @Override
    public String findPatient(Integer id) {
     String patient = patientMapper.findByName(id);
     return patient;
    }

    @Override
    public Patient selectById(Integer id) {
       Patient patient= patientMapper.selectById(id);
        return patient;
    }

    @Override
    public String updateId(@Param("id") Integer id, @Param("phone") String phone) {
        patientMapper.updateId(id,phone);
        return "修改成功";
    }

    @Override
    public String add(Patient patient) {
        patientMapper.add(patient);
        return "添加成功";
    }
}




